<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="jakarta.tags.core" %>

<div style="display: grid; grid-template-columns: 120px 1fr; gap: 15px; margin-bottom: 20px;">
    <div>
        <label>产品名称:</label>
    </div>
    <div>
        <input type="text" name="name" value="${product.name}" required style="padding: 8px; width: 100%;">
    </div>

    <div>
        <label>分类:</label>
    </div>
    <div>
        <input type="text" name="category" value="${product.category}" style="padding: 8px; width: 100%;">
    </div>

    <div>
        <label>品牌:</label>
    </div>
    <div>
        <input type="text" name="brand" value="${product.brand}" style="padding: 8px; width: 100%;">
    </div>

    <div>
        <label>价格:</label>
    </div>
    <div>
        <input type="number" step="0.01" name="price" value="${product.price}" required style="padding: 8px; width: 100%;">
    </div>

    <div>
        <label>库存:</label>
    </div>
    <div>
        <input type="number" name="stock" value="${product.stock}" required style="padding: 8px; width: 100%;">
    </div>

    <div>
        <label>状态:</label>
    </div>
    <div>
        <select name="status" style="padding: 8px; width: 100%;">
            <option value="1" <c:if test="${product.status == 1}">selected</c:if>>上架</option>
            <option value="0" <c:if test="${product.status == 0}">selected</c:if>>下架</option>
        </select>
    </div>
</div>